// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate lazy_static;
extern crate location;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// A Google Edge Cloud zone.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Zone {
    /// Required. The resource name of the zone.
    pub name: std::string::String,

    /// Output only. The time when the zone was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the zone was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Deprecated: not implemented.
    /// Labels as key value pairs.
    #[deprecated]
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Deprecated: not implemented.
    /// The deployment layout type.
    #[deprecated]
    pub layout_name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Zone {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Zone::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Zone::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Zone::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Zone::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Zone::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Zone::labels].
    #[deprecated]
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [layout_name][crate::model::Zone::layout_name].
    #[deprecated]
    pub fn set_layout_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.layout_name = v.into();
        self
    }
}

impl wkt::message::Message for Zone {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.Zone"
    }
}

/// Message describing Network object
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Network {
    /// Required. The canonical resource name of the network.
    pub name: std::string::String,

    /// Output only. The time when the network was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the network was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels associated with this resource.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. A free-text description of the resource. Max length 1024
    /// characters.
    pub description: std::string::String,

    /// IP (L3) MTU value of the network.
    /// Valid values are: 1500 and 9000.
    /// Default to 1500 if not set.
    pub mtu: i32,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Network {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Network::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Network::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Network::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Network::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Network::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Network::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::Network::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [mtu][crate::model::Network::mtu].
    pub fn set_mtu<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.mtu = v.into();
        self
    }
}

impl wkt::message::Message for Network {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.Network"
    }
}

/// Message describing Subnet object
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Subnet {
    /// Required. The canonical resource name of the subnet.
    pub name: std::string::String,

    /// Output only. The time when the subnet was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the subnet was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels associated with this resource.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. A free-text description of the resource. Max length 1024
    /// characters.
    pub description: std::string::String,

    /// Required. The network that this subnetwork belongs to.
    pub network: std::string::String,

    /// The ranges of ipv4 addresses that are owned by this subnetwork.
    pub ipv4_cidr: std::vec::Vec<std::string::String>,

    /// The ranges of ipv6 addresses that are owned by this subnetwork.
    pub ipv6_cidr: std::vec::Vec<std::string::String>,

    /// Optional. VLAN id provided by user. If not specified we assign one
    /// automatically.
    pub vlan_id: i32,

    /// Optional. A bonding type in the subnet creation specifies whether a VLAN
    /// being created will be present on Bonded or Non-Bonded or Both port types.
    /// In addition, this flag is to be used to set the specific network
    /// configuration which clusters can then use for their workloads based on the
    /// bonding choice.
    pub bonding_type: crate::model::subnet::BondingType,

    /// Output only. Current stage of the resource to the device by config push.
    pub state: crate::model::ResourceState,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Subnet {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Subnet::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Subnet::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Subnet::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Subnet::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Subnet::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Subnet::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::Subnet::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [network][crate::model::Subnet::network].
    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.network = v.into();
        self
    }

    /// Sets the value of [ipv4_cidr][crate::model::Subnet::ipv4_cidr].
    pub fn set_ipv4_cidr<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.ipv4_cidr = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [ipv6_cidr][crate::model::Subnet::ipv6_cidr].
    pub fn set_ipv6_cidr<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.ipv6_cidr = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [vlan_id][crate::model::Subnet::vlan_id].
    pub fn set_vlan_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.vlan_id = v.into();
        self
    }

    /// Sets the value of [bonding_type][crate::model::Subnet::bonding_type].
    pub fn set_bonding_type<T: std::convert::Into<crate::model::subnet::BondingType>>(
        mut self,
        v: T,
    ) -> Self {
        self.bonding_type = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Subnet::state].
    pub fn set_state<T: std::convert::Into<crate::model::ResourceState>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }
}

impl wkt::message::Message for Subnet {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.Subnet"
    }
}

/// Defines additional types related to [Subnet].
pub mod subnet {
    #[allow(unused_imports)]
    use super::*;

    /// Bonding type in the subnet.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum BondingType {
        /// Unspecified
        /// Bonding type will be unspecified by default and if the user chooses to
        /// not specify a bonding type at time of creating the VLAN. This will be
        /// treated as mixed bonding where the VLAN will have both bonded and
        /// non-bonded connectivity to machines.
        Unspecified,
        /// Multi homed.
        Bonded,
        /// Single homed.
        NonBonded,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [BondingType::value] or
        /// [BondingType::name].
        UnknownValue(bonding_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod bonding_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl BondingType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Bonded => std::option::Option::Some(1),
                Self::NonBonded => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("BONDING_TYPE_UNSPECIFIED"),
                Self::Bonded => std::option::Option::Some("BONDED"),
                Self::NonBonded => std::option::Option::Some("NON_BONDED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for BondingType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for BondingType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for BondingType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Bonded,
                2 => Self::NonBonded,
                _ => Self::UnknownValue(bonding_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for BondingType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "BONDING_TYPE_UNSPECIFIED" => Self::Unspecified,
                "BONDED" => Self::Bonded,
                "NON_BONDED" => Self::NonBonded,
                _ => Self::UnknownValue(bonding_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for BondingType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Bonded => serializer.serialize_i32(1),
                Self::NonBonded => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for BondingType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BondingType>::new(
                ".google.cloud.edgenetwork.v1.Subnet.BondingType",
            ))
        }
    }
}

/// Message describing Interconnect object
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Interconnect {
    /// Required. The canonical resource name of the interconnect.
    pub name: std::string::String,

    /// Output only. The time when the subnet was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the subnet was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels associated with this resource.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. A free-text description of the resource. Max length 1024
    /// characters.
    pub description: std::string::String,

    /// Optional. Type of interconnect, which takes only the value 'DEDICATED' for
    /// now.
    pub interconnect_type: crate::model::interconnect::InterconnectType,

    /// Output only. Unique identifier for the link.
    pub uuid: std::string::String,

    /// Output only. Cloud resource name of the switch device.
    pub device_cloud_resource_name: std::string::String,

    /// Output only. Physical ports (e.g., TenGigE0/0/0/1) that form the
    /// interconnect.
    pub physical_ports: std::vec::Vec<std::string::String>,

    /// Optional. The remote peering network type of the interconnect. It is
    /// required when peering separation is enabled.
    pub remote_peering_network_type: crate::model::RemotePeeringNetworkType,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Interconnect {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Interconnect::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Interconnect::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Interconnect::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Interconnect::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Interconnect::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Interconnect::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::Interconnect::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [interconnect_type][crate::model::Interconnect::interconnect_type].
    pub fn set_interconnect_type<
        T: std::convert::Into<crate::model::interconnect::InterconnectType>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.interconnect_type = v.into();
        self
    }

    /// Sets the value of [uuid][crate::model::Interconnect::uuid].
    pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uuid = v.into();
        self
    }

    /// Sets the value of [device_cloud_resource_name][crate::model::Interconnect::device_cloud_resource_name].
    pub fn set_device_cloud_resource_name<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.device_cloud_resource_name = v.into();
        self
    }

    /// Sets the value of [physical_ports][crate::model::Interconnect::physical_ports].
    pub fn set_physical_ports<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.physical_ports = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [remote_peering_network_type][crate::model::Interconnect::remote_peering_network_type].
    pub fn set_remote_peering_network_type<
        T: std::convert::Into<crate::model::RemotePeeringNetworkType>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.remote_peering_network_type = v.into();
        self
    }
}

impl wkt::message::Message for Interconnect {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.Interconnect"
    }
}

/// Defines additional types related to [Interconnect].
pub mod interconnect {
    #[allow(unused_imports)]
    use super::*;

    /// Type of interconnect.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum InterconnectType {
        /// Unspecified.
        Unspecified,
        /// Dedicated Interconnect.
        Dedicated,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [InterconnectType::value] or
        /// [InterconnectType::name].
        UnknownValue(interconnect_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod interconnect_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl InterconnectType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Dedicated => std::option::Option::Some(1),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("INTERCONNECT_TYPE_UNSPECIFIED"),
                Self::Dedicated => std::option::Option::Some("DEDICATED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for InterconnectType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for InterconnectType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for InterconnectType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Dedicated,
                _ => Self::UnknownValue(interconnect_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for InterconnectType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "INTERCONNECT_TYPE_UNSPECIFIED" => Self::Unspecified,
                "DEDICATED" => Self::Dedicated,
                _ => Self::UnknownValue(interconnect_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for InterconnectType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Dedicated => serializer.serialize_i32(1),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for InterconnectType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<InterconnectType>::new(
                ".google.cloud.edgenetwork.v1.Interconnect.InterconnectType",
            ))
        }
    }
}

/// Message describing InterconnectAttachment object
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InterconnectAttachment {
    /// Required. The canonical resource name of the interconnect attachment.
    pub name: std::string::String,

    /// Output only. The time when the interconnect attachment was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the interconnect attachment was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels associated with this resource.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. A free-text description of the resource. Max length 1024
    /// characters.
    pub description: std::string::String,

    /// Required. The canonical name of underlying Interconnect object that this
    /// attachment's traffic will traverse through. The name is in the form of
    /// `projects/{project}/locations/{location}/zones/{zone}/interconnects/{interconnect}`.
    pub interconnect: std::string::String,

    /// Optional. The canonical Network name in the form of
    /// `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`.
    pub network: std::string::String,

    /// Required. VLAN id provided by user. Must be site-wise unique.
    pub vlan_id: i32,

    /// IP (L3) MTU value of the virtual edge cloud.
    /// Valid values are: 1500 and 9000.
    /// Default to 1500 if not set.
    pub mtu: i32,

    /// Output only. Current stage of the resource to the device by config push.
    pub state: crate::model::ResourceState,

    /// Optional. The remote peering network type of the underlying interconnect.
    /// It is required when peering separation is enabled.
    pub peering_type: crate::model::RemotePeeringNetworkType,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InterconnectAttachment {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::InterconnectAttachment::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::InterconnectAttachment::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::InterconnectAttachment::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::InterconnectAttachment::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::InterconnectAttachment::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::InterconnectAttachment::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::InterconnectAttachment::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [interconnect][crate::model::InterconnectAttachment::interconnect].
    pub fn set_interconnect<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.interconnect = v.into();
        self
    }

    /// Sets the value of [network][crate::model::InterconnectAttachment::network].
    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.network = v.into();
        self
    }

    /// Sets the value of [vlan_id][crate::model::InterconnectAttachment::vlan_id].
    pub fn set_vlan_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.vlan_id = v.into();
        self
    }

    /// Sets the value of [mtu][crate::model::InterconnectAttachment::mtu].
    pub fn set_mtu<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.mtu = v.into();
        self
    }

    /// Sets the value of [state][crate::model::InterconnectAttachment::state].
    pub fn set_state<T: std::convert::Into<crate::model::ResourceState>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [peering_type][crate::model::InterconnectAttachment::peering_type].
    pub fn set_peering_type<T: std::convert::Into<crate::model::RemotePeeringNetworkType>>(
        mut self,
        v: T,
    ) -> Self {
        self.peering_type = v.into();
        self
    }
}

impl wkt::message::Message for InterconnectAttachment {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.InterconnectAttachment"
    }
}

/// Message describing Router object
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Router {
    /// Required. The canonical resource name of the router.
    pub name: std::string::String,

    /// Output only. The time when the router was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the router was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels associated with this resource.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. A free-text description of the resource. Max length 1024
    /// characters.
    pub description: std::string::String,

    /// Required. The canonical name of the network to which this router belongs.
    /// The name is in the form of
    /// `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`.
    pub network: std::string::String,

    /// Router interfaces.
    pub interface: std::vec::Vec<crate::model::router::Interface>,

    /// BGP peers.
    pub bgp_peer: std::vec::Vec<crate::model::router::BgpPeer>,

    /// BGP information specific to this router.
    pub bgp: std::option::Option<crate::model::router::Bgp>,

    /// Output only. Current stage of the resource to the device by config push.
    pub state: crate::model::ResourceState,

    /// Optional. A list of CIDRs in IP/Length format to advertise northbound as
    /// static routes from this router.
    pub route_advertisements: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Router {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Router::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Router::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Router::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Router::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Router::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Router::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::Router::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [network][crate::model::Router::network].
    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.network = v.into();
        self
    }

    /// Sets the value of [interface][crate::model::Router::interface].
    pub fn set_interface<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::router::Interface>,
    {
        use std::iter::Iterator;
        self.interface = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [bgp_peer][crate::model::Router::bgp_peer].
    pub fn set_bgp_peer<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::router::BgpPeer>,
    {
        use std::iter::Iterator;
        self.bgp_peer = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [bgp][crate::model::Router::bgp].
    pub fn set_bgp<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::router::Bgp>,
    {
        self.bgp = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [bgp][crate::model::Router::bgp].
    pub fn set_or_clear_bgp<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::router::Bgp>,
    {
        self.bgp = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::Router::state].
    pub fn set_state<T: std::convert::Into<crate::model::ResourceState>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [route_advertisements][crate::model::Router::route_advertisements].
    pub fn set_route_advertisements<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.route_advertisements = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for Router {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.Router"
    }
}

/// Defines additional types related to [Router].
pub mod router {
    #[allow(unused_imports)]
    use super::*;

    /// Router Interface defines the GDCE zone side layer-3 information for
    /// building the BGP session.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Interface {
        /// Name of this interface entry. Unique within the Zones resource.
        pub name: std::string::String,

        /// IP address and range of the interface.
        pub ipv4_cidr: std::string::String,

        /// IPv6 address and range of the interface.
        pub ipv6_cidr: std::string::String,

        /// The canonical name of the linked Interconnect attachment.
        pub linked_interconnect_attachment: std::string::String,

        /// The canonical name of the subnetwork resource that this interface
        /// belongs to.
        pub subnetwork: std::string::String,

        /// Create loopback interface in the router when specified.
        /// The number of IP addresses must match the number of TOR devices.
        pub loopback_ip_addresses: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Interface {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [name][crate::model::router::Interface::name].
        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.name = v.into();
            self
        }

        /// Sets the value of [ipv4_cidr][crate::model::router::Interface::ipv4_cidr].
        pub fn set_ipv4_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.ipv4_cidr = v.into();
            self
        }

        /// Sets the value of [ipv6_cidr][crate::model::router::Interface::ipv6_cidr].
        pub fn set_ipv6_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.ipv6_cidr = v.into();
            self
        }

        /// Sets the value of [linked_interconnect_attachment][crate::model::router::Interface::linked_interconnect_attachment].
        pub fn set_linked_interconnect_attachment<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.linked_interconnect_attachment = v.into();
            self
        }

        /// Sets the value of [subnetwork][crate::model::router::Interface::subnetwork].
        pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.subnetwork = v.into();
            self
        }

        /// Sets the value of [loopback_ip_addresses][crate::model::router::Interface::loopback_ip_addresses].
        pub fn set_loopback_ip_addresses<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.loopback_ip_addresses = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for Interface {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.edgenetwork.v1.Router.Interface"
        }
    }

    /// BGPPeer defines the peer side layer-3 information for building the BGP
    /// session.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct BgpPeer {
        /// Name of this BGP peer. Unique within the Zones resource.
        pub name: std::string::String,

        /// Name of the RouterInterface the BGP peer is associated with.
        pub interface: std::string::String,

        /// IP range of the interface within Google.
        pub interface_ipv4_cidr: std::string::String,

        /// IPv6 range of the interface within Google.
        pub interface_ipv6_cidr: std::string::String,

        /// IP range of the BGP interface outside Google.
        pub peer_ipv4_cidr: std::string::String,

        /// IPv6 range of the BGP interface outside Google.
        pub peer_ipv6_cidr: std::string::String,

        /// Peer BGP Autonomous System Number (ASN). Each BGP interface may use
        /// a different value.
        pub peer_asn: u32,

        /// Output only. Local BGP Autonomous System Number (ASN).
        /// This field is ST_NOT_REQUIRED because it stores private ASNs, which are
        /// meaningless outside the zone in which they are being used.
        pub local_asn: u32,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl BgpPeer {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [name][crate::model::router::BgpPeer::name].
        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.name = v.into();
            self
        }

        /// Sets the value of [interface][crate::model::router::BgpPeer::interface].
        pub fn set_interface<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.interface = v.into();
            self
        }

        /// Sets the value of [interface_ipv4_cidr][crate::model::router::BgpPeer::interface_ipv4_cidr].
        pub fn set_interface_ipv4_cidr<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.interface_ipv4_cidr = v.into();
            self
        }

        /// Sets the value of [interface_ipv6_cidr][crate::model::router::BgpPeer::interface_ipv6_cidr].
        pub fn set_interface_ipv6_cidr<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.interface_ipv6_cidr = v.into();
            self
        }

        /// Sets the value of [peer_ipv4_cidr][crate::model::router::BgpPeer::peer_ipv4_cidr].
        pub fn set_peer_ipv4_cidr<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.peer_ipv4_cidr = v.into();
            self
        }

        /// Sets the value of [peer_ipv6_cidr][crate::model::router::BgpPeer::peer_ipv6_cidr].
        pub fn set_peer_ipv6_cidr<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.peer_ipv6_cidr = v.into();
            self
        }

        /// Sets the value of [peer_asn][crate::model::router::BgpPeer::peer_asn].
        pub fn set_peer_asn<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
            self.peer_asn = v.into();
            self
        }

        /// Sets the value of [local_asn][crate::model::router::BgpPeer::local_asn].
        pub fn set_local_asn<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
            self.local_asn = v.into();
            self
        }
    }

    impl wkt::message::Message for BgpPeer {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.edgenetwork.v1.Router.BgpPeer"
        }
    }

    /// BGP information specific to this router.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Bgp {
        /// Locally assigned BGP ASN.
        pub asn: u32,

        /// The interval in seconds between BGP keepalive messages that are
        /// sent to the peer. Default is 20 with value between 20 and 60.
        pub keepalive_interval_in_seconds: u32,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Bgp {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [asn][crate::model::router::Bgp::asn].
        pub fn set_asn<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
            self.asn = v.into();
            self
        }

        /// Sets the value of [keepalive_interval_in_seconds][crate::model::router::Bgp::keepalive_interval_in_seconds].
        pub fn set_keepalive_interval_in_seconds<T: std::convert::Into<u32>>(
            mut self,
            v: T,
        ) -> Self {
            self.keepalive_interval_in_seconds = v.into();
            self
        }
    }

    impl wkt::message::Message for Bgp {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.edgenetwork.v1.Router.Bgp"
        }
    }
}

/// LinkLayerAddress contains an IP address and corresponding link-layer address.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkLayerAddress {
    /// The MAC address of this neighbor.
    pub mac_address: std::string::String,

    /// The IP address of this neighbor.
    pub ip_address: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LinkLayerAddress {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [mac_address][crate::model::LinkLayerAddress::mac_address].
    pub fn set_mac_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mac_address = v.into();
        self
    }

    /// Sets the value of [ip_address][crate::model::LinkLayerAddress::ip_address].
    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.ip_address = v.into();
        self
    }
}

impl wkt::message::Message for LinkLayerAddress {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.LinkLayerAddress"
    }
}

/// SubnetStatus contains detailed and current technical information about this
/// subnet resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SubnetStatus {
    /// The name of CCFE subnet resource.
    pub name: std::string::String,

    /// BVI MAC address.
    pub mac_address: std::string::String,

    /// A list of LinkLayerAddress, describing the ip address and corresponding
    /// link-layer address of the neighbors for this subnet.
    pub link_layer_addresses: std::vec::Vec<crate::model::LinkLayerAddress>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SubnetStatus {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::SubnetStatus::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [mac_address][crate::model::SubnetStatus::mac_address].
    pub fn set_mac_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mac_address = v.into();
        self
    }

    /// Sets the value of [link_layer_addresses][crate::model::SubnetStatus::link_layer_addresses].
    pub fn set_link_layer_addresses<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::LinkLayerAddress>,
    {
        use std::iter::Iterator;
        self.link_layer_addresses = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for SubnetStatus {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.SubnetStatus"
    }
}

/// Diagnostics information about interconnect, contains detailed and current
/// technical information about Google's side of the connection.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InterconnectDiagnostics {
    /// The MAC address of the Interconnect's bundle interface.
    pub mac_address: std::string::String,

    /// A list of LinkLayerAddress, describing the ip address and corresponding
    /// link-layer address of the neighbors for this interconnect.
    pub link_layer_addresses: std::vec::Vec<crate::model::LinkLayerAddress>,

    /// A list of LinkStatus objects, used to describe the status for each link on
    /// the Interconnect.
    pub links: std::vec::Vec<crate::model::interconnect_diagnostics::LinkStatus>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InterconnectDiagnostics {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [mac_address][crate::model::InterconnectDiagnostics::mac_address].
    pub fn set_mac_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mac_address = v.into();
        self
    }

    /// Sets the value of [link_layer_addresses][crate::model::InterconnectDiagnostics::link_layer_addresses].
    pub fn set_link_layer_addresses<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::LinkLayerAddress>,
    {
        use std::iter::Iterator;
        self.link_layer_addresses = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [links][crate::model::InterconnectDiagnostics::links].
    pub fn set_links<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::interconnect_diagnostics::LinkStatus>,
    {
        use std::iter::Iterator;
        self.links = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for InterconnectDiagnostics {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.InterconnectDiagnostics"
    }
}

/// Defines additional types related to [InterconnectDiagnostics].
pub mod interconnect_diagnostics {
    #[allow(unused_imports)]
    use super::*;

    /// Describing the status for each link on the Interconnect.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct LinkStatus {
        /// The unique ID for this link assigned during turn up by Google.
        pub circuit_id: std::string::String,

        /// Describing the state of a LACP link.
        pub lacp_status:
            std::option::Option<crate::model::interconnect_diagnostics::LinkLACPStatus>,

        /// A list of LinkLLDPStatus objects, used to describe LLDP status of each
        /// peer for each link on the Interconnect.
        pub lldp_statuses: std::vec::Vec<crate::model::interconnect_diagnostics::LinkLLDPStatus>,

        /// Packet counts specific statistics for this link.
        pub packet_counts:
            std::option::Option<crate::model::interconnect_diagnostics::PacketCounts>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl LinkStatus {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [circuit_id][crate::model::interconnect_diagnostics::LinkStatus::circuit_id].
        pub fn set_circuit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.circuit_id = v.into();
            self
        }

        /// Sets the value of [lacp_status][crate::model::interconnect_diagnostics::LinkStatus::lacp_status].
        pub fn set_lacp_status<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::interconnect_diagnostics::LinkLACPStatus>,
        {
            self.lacp_status = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [lacp_status][crate::model::interconnect_diagnostics::LinkStatus::lacp_status].
        pub fn set_or_clear_lacp_status<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::interconnect_diagnostics::LinkLACPStatus>,
        {
            self.lacp_status = v.map(|x| x.into());
            self
        }

        /// Sets the value of [lldp_statuses][crate::model::interconnect_diagnostics::LinkStatus::lldp_statuses].
        pub fn set_lldp_statuses<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::interconnect_diagnostics::LinkLLDPStatus>,
        {
            use std::iter::Iterator;
            self.lldp_statuses = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [packet_counts][crate::model::interconnect_diagnostics::LinkStatus::packet_counts].
        pub fn set_packet_counts<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::interconnect_diagnostics::PacketCounts>,
        {
            self.packet_counts = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [packet_counts][crate::model::interconnect_diagnostics::LinkStatus::packet_counts].
        pub fn set_or_clear_packet_counts<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::interconnect_diagnostics::PacketCounts>,
        {
            self.packet_counts = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for LinkStatus {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkStatus"
        }
    }

    /// Containing a collection of interface-related statistics objects.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct PacketCounts {
        /// The number of packets that are delivered.
        pub inbound_unicast: i64,

        /// The number of inbound packets that contained errors.
        pub inbound_errors: i64,

        /// The number of inbound packets that were chosen to be discarded even
        /// though no errors had been detected to prevent their being deliverable.
        pub inbound_discards: i64,

        /// The total number of packets that are requested be transmitted.
        pub outbound_unicast: i64,

        /// The number of outbound packets that could not be transmitted because of
        /// errors.
        pub outbound_errors: i64,

        /// The number of outbound packets that were chosen to be discarded even
        /// though no errors had been detected to prevent their being transmitted.
        pub outbound_discards: i64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl PacketCounts {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [inbound_unicast][crate::model::interconnect_diagnostics::PacketCounts::inbound_unicast].
        pub fn set_inbound_unicast<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.inbound_unicast = v.into();
            self
        }

        /// Sets the value of [inbound_errors][crate::model::interconnect_diagnostics::PacketCounts::inbound_errors].
        pub fn set_inbound_errors<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.inbound_errors = v.into();
            self
        }

        /// Sets the value of [inbound_discards][crate::model::interconnect_diagnostics::PacketCounts::inbound_discards].
        pub fn set_inbound_discards<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.inbound_discards = v.into();
            self
        }

        /// Sets the value of [outbound_unicast][crate::model::interconnect_diagnostics::PacketCounts::outbound_unicast].
        pub fn set_outbound_unicast<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.outbound_unicast = v.into();
            self
        }

        /// Sets the value of [outbound_errors][crate::model::interconnect_diagnostics::PacketCounts::outbound_errors].
        pub fn set_outbound_errors<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.outbound_errors = v.into();
            self
        }

        /// Sets the value of [outbound_discards][crate::model::interconnect_diagnostics::PacketCounts::outbound_discards].
        pub fn set_outbound_discards<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.outbound_discards = v.into();
            self
        }
    }

    impl wkt::message::Message for PacketCounts {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.edgenetwork.v1.InterconnectDiagnostics.PacketCounts"
        }
    }

    /// Describing the status of a LACP link.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct LinkLACPStatus {
        /// The state of a LACP link.
        pub state: crate::model::interconnect_diagnostics::link_lacp_status::State,

        /// System ID of the port on Google's side of the LACP exchange.
        pub google_system_id: std::string::String,

        /// System ID of the port on the neighbor's side of the LACP exchange.
        pub neighbor_system_id: std::string::String,

        /// A true value indicates that the participant will allow the link to be
        /// used as part of the aggregate.
        /// A false value indicates the link should be used as an individual link.
        pub aggregatable: bool,

        /// If true, the participant is collecting incoming frames on the link,
        /// otherwise false
        pub collecting: bool,

        /// When true, the participant is distributing outgoing frames; when false,
        /// distribution is disabled
        pub distributing: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl LinkLACPStatus {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [state][crate::model::interconnect_diagnostics::LinkLACPStatus::state].
        pub fn set_state<
            T: std::convert::Into<crate::model::interconnect_diagnostics::link_lacp_status::State>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.state = v.into();
            self
        }

        /// Sets the value of [google_system_id][crate::model::interconnect_diagnostics::LinkLACPStatus::google_system_id].
        pub fn set_google_system_id<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.google_system_id = v.into();
            self
        }

        /// Sets the value of [neighbor_system_id][crate::model::interconnect_diagnostics::LinkLACPStatus::neighbor_system_id].
        pub fn set_neighbor_system_id<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.neighbor_system_id = v.into();
            self
        }

        /// Sets the value of [aggregatable][crate::model::interconnect_diagnostics::LinkLACPStatus::aggregatable].
        pub fn set_aggregatable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.aggregatable = v.into();
            self
        }

        /// Sets the value of [collecting][crate::model::interconnect_diagnostics::LinkLACPStatus::collecting].
        pub fn set_collecting<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.collecting = v.into();
            self
        }

        /// Sets the value of [distributing][crate::model::interconnect_diagnostics::LinkLACPStatus::distributing].
        pub fn set_distributing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.distributing = v.into();
            self
        }
    }

    impl wkt::message::Message for LinkLACPStatus {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLACPStatus"
        }
    }

    /// Defines additional types related to [LinkLACPStatus].
    pub mod link_lacp_status {
        #[allow(unused_imports)]
        use super::*;

        /// State enum for LACP link.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum State {
            /// The default state indicating state is in unknown state.
            Unknown,
            /// The link is configured and active within the bundle.
            Active,
            /// The link is not configured within the bundle, this means the rest of
            /// the object should be empty.
            Detached,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [State::value] or
            /// [State::name].
            UnknownValue(state::UnknownValue),
        }

        #[doc(hidden)]
        pub mod state {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl State {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unknown => std::option::Option::Some(0),
                    Self::Active => std::option::Option::Some(1),
                    Self::Detached => std::option::Option::Some(2),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unknown => std::option::Option::Some("UNKNOWN"),
                    Self::Active => std::option::Option::Some("ACTIVE"),
                    Self::Detached => std::option::Option::Some("DETACHED"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for State {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for State {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for State {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unknown,
                    1 => Self::Active,
                    2 => Self::Detached,
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for State {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "UNKNOWN" => Self::Unknown,
                    "ACTIVE" => Self::Active,
                    "DETACHED" => Self::Detached,
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for State {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unknown => serializer.serialize_i32(0),
                    Self::Active => serializer.serialize_i32(1),
                    Self::Detached => serializer.serialize_i32(2),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for State {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                    ".google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLACPStatus.State",
                ))
            }
        }
    }

    /// Describing a LLDP link.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct LinkLLDPStatus {
        /// The peer system's administratively assigned name.
        pub peer_system_name: std::string::String,

        /// The textual description of the network entity of LLDP peer.
        pub peer_system_description: std::string::String,

        /// The peer chassis component of the endpoint identifier associated with the
        /// transmitting LLDP agent.
        pub peer_chassis_id: std::string::String,

        /// The format and source of the peer chassis identifier string.
        pub peer_chassis_id_type: std::string::String,

        /// The port component of the endpoint identifier associated with the
        /// transmitting LLDP agent. If the specified port is an IEEE 802.3 Repeater
        /// port, then this TLV is optional.
        pub peer_port_id: std::string::String,

        /// The format and source of the peer port identifier string.
        pub peer_port_id_type: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl LinkLLDPStatus {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [peer_system_name][crate::model::interconnect_diagnostics::LinkLLDPStatus::peer_system_name].
        pub fn set_peer_system_name<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.peer_system_name = v.into();
            self
        }

        /// Sets the value of [peer_system_description][crate::model::interconnect_diagnostics::LinkLLDPStatus::peer_system_description].
        pub fn set_peer_system_description<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.peer_system_description = v.into();
            self
        }

        /// Sets the value of [peer_chassis_id][crate::model::interconnect_diagnostics::LinkLLDPStatus::peer_chassis_id].
        pub fn set_peer_chassis_id<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.peer_chassis_id = v.into();
            self
        }

        /// Sets the value of [peer_chassis_id_type][crate::model::interconnect_diagnostics::LinkLLDPStatus::peer_chassis_id_type].
        pub fn set_peer_chassis_id_type<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.peer_chassis_id_type = v.into();
            self
        }

        /// Sets the value of [peer_port_id][crate::model::interconnect_diagnostics::LinkLLDPStatus::peer_port_id].
        pub fn set_peer_port_id<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.peer_port_id = v.into();
            self
        }

        /// Sets the value of [peer_port_id_type][crate::model::interconnect_diagnostics::LinkLLDPStatus::peer_port_id_type].
        pub fn set_peer_port_id_type<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.peer_port_id_type = v.into();
            self
        }
    }

    impl wkt::message::Message for LinkLLDPStatus {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLLDPStatus"
        }
    }
}

/// Describing the current status of a router.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouterStatus {
    /// The canonical name of the network to which this router belongs.
    pub network: std::string::String,

    /// A list of BgpPeerStatus objects, describing all BGP peers related to this
    /// router.
    pub bgp_peer_status: std::vec::Vec<crate::model::router_status::BgpPeerStatus>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RouterStatus {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [network][crate::model::RouterStatus::network].
    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.network = v.into();
        self
    }

    /// Sets the value of [bgp_peer_status][crate::model::RouterStatus::bgp_peer_status].
    pub fn set_bgp_peer_status<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::router_status::BgpPeerStatus>,
    {
        use std::iter::Iterator;
        self.bgp_peer_status = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for RouterStatus {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.RouterStatus"
    }
}

/// Defines additional types related to [RouterStatus].
pub mod router_status {
    #[allow(unused_imports)]
    use super::*;

    /// Status of a BGP peer.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct BgpPeerStatus {
        /// Name of this BGP peer. Unique within the Routers resource.
        pub name: std::string::String,

        /// IP address of the local BGP interface.
        pub ip_address: std::string::String,

        /// IP address of the remote BGP interface.
        pub peer_ip_address: std::string::String,

        /// The current status of BGP.
        pub status: crate::model::router_status::bgp_peer_status::BgpStatus,

        /// BGP state as specified in RFC1771.
        pub state: std::string::String,

        /// Time this session has been up.
        /// Format:
        /// 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds
        pub uptime: std::string::String,

        /// Time this session has been up, in seconds.
        pub uptime_seconds: i64,

        /// A collection of counts for prefixes.
        pub prefix_counter: std::option::Option<crate::model::router_status::PrefixCounter>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl BgpPeerStatus {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [name][crate::model::router_status::BgpPeerStatus::name].
        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.name = v.into();
            self
        }

        /// Sets the value of [ip_address][crate::model::router_status::BgpPeerStatus::ip_address].
        pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.ip_address = v.into();
            self
        }

        /// Sets the value of [peer_ip_address][crate::model::router_status::BgpPeerStatus::peer_ip_address].
        pub fn set_peer_ip_address<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.peer_ip_address = v.into();
            self
        }

        /// Sets the value of [status][crate::model::router_status::BgpPeerStatus::status].
        pub fn set_status<
            T: std::convert::Into<crate::model::router_status::bgp_peer_status::BgpStatus>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.status = v.into();
            self
        }

        /// Sets the value of [state][crate::model::router_status::BgpPeerStatus::state].
        pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.state = v.into();
            self
        }

        /// Sets the value of [uptime][crate::model::router_status::BgpPeerStatus::uptime].
        pub fn set_uptime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.uptime = v.into();
            self
        }

        /// Sets the value of [uptime_seconds][crate::model::router_status::BgpPeerStatus::uptime_seconds].
        pub fn set_uptime_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.uptime_seconds = v.into();
            self
        }

        /// Sets the value of [prefix_counter][crate::model::router_status::BgpPeerStatus::prefix_counter].
        pub fn set_prefix_counter<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::router_status::PrefixCounter>,
        {
            self.prefix_counter = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [prefix_counter][crate::model::router_status::BgpPeerStatus::prefix_counter].
        pub fn set_or_clear_prefix_counter<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::router_status::PrefixCounter>,
        {
            self.prefix_counter = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for BgpPeerStatus {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.edgenetwork.v1.RouterStatus.BgpPeerStatus"
        }
    }

    /// Defines additional types related to [BgpPeerStatus].
    pub mod bgp_peer_status {
        #[allow(unused_imports)]
        use super::*;

        /// Status of the BGP peer: {UP, DOWN}
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum BgpStatus {
            /// The default status indicating BGP session is in unknown state.
            Unknown,
            /// The UP status indicating BGP session is established.
            Up,
            /// The DOWN state indicating BGP session is not established yet.
            Down,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [BgpStatus::value] or
            /// [BgpStatus::name].
            UnknownValue(bgp_status::UnknownValue),
        }

        #[doc(hidden)]
        pub mod bgp_status {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl BgpStatus {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unknown => std::option::Option::Some(0),
                    Self::Up => std::option::Option::Some(1),
                    Self::Down => std::option::Option::Some(2),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unknown => std::option::Option::Some("UNKNOWN"),
                    Self::Up => std::option::Option::Some("UP"),
                    Self::Down => std::option::Option::Some("DOWN"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for BgpStatus {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for BgpStatus {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for BgpStatus {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unknown,
                    1 => Self::Up,
                    2 => Self::Down,
                    _ => Self::UnknownValue(bgp_status::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for BgpStatus {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "UNKNOWN" => Self::Unknown,
                    "UP" => Self::Up,
                    "DOWN" => Self::Down,
                    _ => Self::UnknownValue(bgp_status::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for BgpStatus {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unknown => serializer.serialize_i32(0),
                    Self::Up => serializer.serialize_i32(1),
                    Self::Down => serializer.serialize_i32(2),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for BgpStatus {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<BgpStatus>::new(
                    ".google.cloud.edgenetwork.v1.RouterStatus.BgpPeerStatus.BgpStatus",
                ))
            }
        }
    }

    /// PrefixCounter contains a collection of prefixes related counts.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct PrefixCounter {
        /// Number of prefixes advertised.
        pub advertised: i64,

        /// Number of prefixes denied.
        pub denied: i64,

        /// Number of prefixes received.
        pub received: i64,

        /// Number of prefixes sent.
        pub sent: i64,

        /// Number of prefixes suppressed.
        pub suppressed: i64,

        /// Number of prefixes withdrawn.
        pub withdrawn: i64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl PrefixCounter {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [advertised][crate::model::router_status::PrefixCounter::advertised].
        pub fn set_advertised<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.advertised = v.into();
            self
        }

        /// Sets the value of [denied][crate::model::router_status::PrefixCounter::denied].
        pub fn set_denied<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.denied = v.into();
            self
        }

        /// Sets the value of [received][crate::model::router_status::PrefixCounter::received].
        pub fn set_received<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.received = v.into();
            self
        }

        /// Sets the value of [sent][crate::model::router_status::PrefixCounter::sent].
        pub fn set_sent<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.sent = v.into();
            self
        }

        /// Sets the value of [suppressed][crate::model::router_status::PrefixCounter::suppressed].
        pub fn set_suppressed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.suppressed = v.into();
            self
        }

        /// Sets the value of [withdrawn][crate::model::router_status::PrefixCounter::withdrawn].
        pub fn set_withdrawn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.withdrawn = v.into();
            self
        }
    }

    impl wkt::message::Message for PrefixCounter {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.edgenetwork.v1.RouterStatus.PrefixCounter"
        }
    }
}

/// Deprecated: not implemented.
/// Message for requesting list of Zones
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct ListZonesRequest {
    /// Required. Parent value for ListZonesRequest
    pub parent: std::string::String,

    /// Requested page size. Server may return fewer items than requested.
    /// If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Filtering results
    pub filter: std::string::String,

    /// Hint for how to order the results
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListZonesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListZonesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListZonesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListZonesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListZonesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListZonesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListZonesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListZonesRequest"
    }
}

/// Deprecated: not implemented.
/// Message for response to listing Zones
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct ListZonesResponse {
    /// The list of Zone
    pub zones: std::vec::Vec<crate::model::Zone>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListZonesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [zones][crate::model::ListZonesResponse::zones].
    pub fn set_zones<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Zone>,
    {
        use std::iter::Iterator;
        self.zones = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListZonesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListZonesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListZonesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListZonesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListZonesResponse {
    type PageItem = crate::model::Zone;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.zones
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Deprecated: not implemented.
/// Message for getting a Zone
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct GetZoneRequest {
    /// Required. Name of the resource
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetZoneRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetZoneRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetZoneRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.GetZoneRequest"
    }
}

/// Message for requesting list of Networks
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListNetworksRequest {
    /// Required. Parent value for ListNetworksRequest
    pub parent: std::string::String,

    /// Requested page size. Server may return fewer items than requested.
    /// If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Filtering results
    pub filter: std::string::String,

    /// Hint for how to order the results
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListNetworksRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListNetworksRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListNetworksRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListNetworksRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListNetworksRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListNetworksRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListNetworksRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListNetworksRequest"
    }
}

/// Message for response to listing Networks
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListNetworksResponse {
    /// The list of Network
    pub networks: std::vec::Vec<crate::model::Network>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListNetworksResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [networks][crate::model::ListNetworksResponse::networks].
    pub fn set_networks<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Network>,
    {
        use std::iter::Iterator;
        self.networks = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListNetworksResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListNetworksResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListNetworksResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListNetworksResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListNetworksResponse {
    type PageItem = crate::model::Network;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.networks
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Message for getting a Network
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetNetworkRequest {
    /// Required. Name of the resource
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetNetworkRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetNetworkRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetNetworkRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.GetNetworkRequest"
    }
}

/// Message for creating a Network
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateNetworkRequest {
    /// Required. Value for parent.
    pub parent: std::string::String,

    /// Required. Id of the requesting object
    /// If auto-generating Id server-side, remove this field and
    /// network_id from the method_signature of Create RPC
    pub network_id: std::string::String,

    /// Required. The resource being created
    pub network: std::option::Option<crate::model::Network>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateNetworkRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateNetworkRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [network_id][crate::model::CreateNetworkRequest::network_id].
    pub fn set_network_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.network_id = v.into();
        self
    }

    /// Sets the value of [network][crate::model::CreateNetworkRequest::network].
    pub fn set_network<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Network>,
    {
        self.network = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [network][crate::model::CreateNetworkRequest::network].
    pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Network>,
    {
        self.network = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateNetworkRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateNetworkRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.CreateNetworkRequest"
    }
}

/// Message for deleting a Network
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteNetworkRequest {
    /// Required. Name of the resource
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteNetworkRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteNetworkRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteNetworkRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteNetworkRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.DeleteNetworkRequest"
    }
}

/// Message for requesting list of Subnets
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSubnetsRequest {
    /// Required. Parent value for ListSubnetsRequest
    pub parent: std::string::String,

    /// Requested page size. Server may return fewer items than requested.
    /// If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Filtering results
    pub filter: std::string::String,

    /// Hint for how to order the results
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListSubnetsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListSubnetsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListSubnetsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListSubnetsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListSubnetsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListSubnetsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListSubnetsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListSubnetsRequest"
    }
}

/// Message for response to listing Subnets
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSubnetsResponse {
    /// The list of Subnet
    pub subnets: std::vec::Vec<crate::model::Subnet>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListSubnetsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [subnets][crate::model::ListSubnetsResponse::subnets].
    pub fn set_subnets<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Subnet>,
    {
        use std::iter::Iterator;
        self.subnets = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListSubnetsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListSubnetsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListSubnetsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListSubnetsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListSubnetsResponse {
    type PageItem = crate::model::Subnet;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.subnets
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Message for getting a Subnet
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSubnetRequest {
    /// Required. Name of the resource
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetSubnetRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetSubnetRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetSubnetRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.GetSubnetRequest"
    }
}

/// Message for creating a Subnet
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSubnetRequest {
    /// Required. Value for parent.
    pub parent: std::string::String,

    /// Required. Id of the requesting object
    /// If auto-generating Id server-side, remove this field and
    /// subnet_id from the method_signature of Create RPC
    pub subnet_id: std::string::String,

    /// Required. The resource being created
    pub subnet: std::option::Option<crate::model::Subnet>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateSubnetRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateSubnetRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [subnet_id][crate::model::CreateSubnetRequest::subnet_id].
    pub fn set_subnet_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.subnet_id = v.into();
        self
    }

    /// Sets the value of [subnet][crate::model::CreateSubnetRequest::subnet].
    pub fn set_subnet<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Subnet>,
    {
        self.subnet = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [subnet][crate::model::CreateSubnetRequest::subnet].
    pub fn set_or_clear_subnet<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Subnet>,
    {
        self.subnet = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateSubnetRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateSubnetRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.CreateSubnetRequest"
    }
}

/// Message for updating a Subnet
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSubnetRequest {
    /// Required. Field mask is used to specify the fields to be overwritten in the
    /// Subnet resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The resource being updated
    pub subnet: std::option::Option<crate::model::Subnet>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateSubnetRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
    pub fn set_subnet<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Subnet>,
    {
        self.subnet = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
    pub fn set_or_clear_subnet<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Subnet>,
    {
        self.subnet = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateSubnetRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateSubnetRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.UpdateSubnetRequest"
    }
}

/// Message for deleting a Subnet
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSubnetRequest {
    /// Required. Name of the resource
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteSubnetRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteSubnetRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteSubnetRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteSubnetRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.DeleteSubnetRequest"
    }
}

/// Message for requesting list of Interconnects
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInterconnectsRequest {
    /// Required. Parent value for ListInterconnectsRequest
    pub parent: std::string::String,

    /// Requested page size. Server may return fewer items than requested.
    /// If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Filtering results
    pub filter: std::string::String,

    /// Hint for how to order the results
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInterconnectsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListInterconnectsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListInterconnectsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListInterconnectsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListInterconnectsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListInterconnectsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListInterconnectsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListInterconnectsRequest"
    }
}

/// Message for response to listing Interconnects
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInterconnectsResponse {
    /// The list of Interconnect
    pub interconnects: std::vec::Vec<crate::model::Interconnect>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInterconnectsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [interconnects][crate::model::ListInterconnectsResponse::interconnects].
    pub fn set_interconnects<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Interconnect>,
    {
        use std::iter::Iterator;
        self.interconnects = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListInterconnectsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListInterconnectsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListInterconnectsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListInterconnectsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListInterconnectsResponse {
    type PageItem = crate::model::Interconnect;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.interconnects
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Message for getting a Interconnect
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetInterconnectRequest {
    /// Required. Name of the resource
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetInterconnectRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetInterconnectRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetInterconnectRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.GetInterconnectRequest"
    }
}

/// Message for requesting list of InterconnectAttachments
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInterconnectAttachmentsRequest {
    /// Required. Parent value for ListInterconnectAttachmentsRequest
    pub parent: std::string::String,

    /// Requested page size. Server may return fewer items than requested.
    /// If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Filtering results
    pub filter: std::string::String,

    /// Hint for how to order the results
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInterconnectAttachmentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListInterconnectAttachmentsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListInterconnectAttachmentsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListInterconnectAttachmentsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListInterconnectAttachmentsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListInterconnectAttachmentsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListInterconnectAttachmentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListInterconnectAttachmentsRequest"
    }
}

/// Message for response to listing InterconnectAttachments
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInterconnectAttachmentsResponse {
    /// The list of InterconnectAttachment
    pub interconnect_attachments: std::vec::Vec<crate::model::InterconnectAttachment>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInterconnectAttachmentsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [interconnect_attachments][crate::model::ListInterconnectAttachmentsResponse::interconnect_attachments].
    pub fn set_interconnect_attachments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::InterconnectAttachment>,
    {
        use std::iter::Iterator;
        self.interconnect_attachments = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListInterconnectAttachmentsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListInterconnectAttachmentsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListInterconnectAttachmentsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListInterconnectAttachmentsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListInterconnectAttachmentsResponse {
    type PageItem = crate::model::InterconnectAttachment;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.interconnect_attachments
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Message for getting a InterconnectAttachment
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetInterconnectAttachmentRequest {
    /// Required. Name of the resource
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetInterconnectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetInterconnectAttachmentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetInterconnectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.GetInterconnectAttachmentRequest"
    }
}

/// Message for creating a InterconnectAttachment
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateInterconnectAttachmentRequest {
    /// Required. Value for parent.
    pub parent: std::string::String,

    /// Required. Id of the requesting object
    /// If auto-generating Id server-side, remove this field and
    /// interconnect_attachment_id from the method_signature of Create RPC
    pub interconnect_attachment_id: std::string::String,

    /// Required. The resource being created
    pub interconnect_attachment: std::option::Option<crate::model::InterconnectAttachment>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateInterconnectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateInterconnectAttachmentRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [interconnect_attachment_id][crate::model::CreateInterconnectAttachmentRequest::interconnect_attachment_id].
    pub fn set_interconnect_attachment_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.interconnect_attachment_id = v.into();
        self
    }

    /// Sets the value of [interconnect_attachment][crate::model::CreateInterconnectAttachmentRequest::interconnect_attachment].
    pub fn set_interconnect_attachment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::InterconnectAttachment>,
    {
        self.interconnect_attachment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [interconnect_attachment][crate::model::CreateInterconnectAttachmentRequest::interconnect_attachment].
    pub fn set_or_clear_interconnect_attachment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::InterconnectAttachment>,
    {
        self.interconnect_attachment = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateInterconnectAttachmentRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateInterconnectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.CreateInterconnectAttachmentRequest"
    }
}

/// Message for deleting a InterconnectAttachment
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteInterconnectAttachmentRequest {
    /// Required. Name of the resource
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteInterconnectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteInterconnectAttachmentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteInterconnectAttachmentRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteInterconnectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.DeleteInterconnectAttachmentRequest"
    }
}

/// Message for requesting list of Routers
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRoutersRequest {
    /// Required. Parent value for ListRoutersRequest
    pub parent: std::string::String,

    /// Requested page size. Server may return fewer items than requested.
    /// If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Filtering results
    pub filter: std::string::String,

    /// Hint for how to order the results
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRoutersRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListRoutersRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListRoutersRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListRoutersRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListRoutersRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListRoutersRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListRoutersRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListRoutersRequest"
    }
}

/// Message for response to listing Routers
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRoutersResponse {
    /// The list of Router
    pub routers: std::vec::Vec<crate::model::Router>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRoutersResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [routers][crate::model::ListRoutersResponse::routers].
    pub fn set_routers<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Router>,
    {
        use std::iter::Iterator;
        self.routers = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListRoutersResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListRoutersResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListRoutersResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.ListRoutersResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListRoutersResponse {
    type PageItem = crate::model::Router;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.routers
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Message for getting a Router
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRouterRequest {
    /// Required. Name of the resource
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetRouterRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetRouterRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetRouterRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.GetRouterRequest"
    }
}

/// Message for creating a Router
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRouterRequest {
    /// Required. Value for parent.
    pub parent: std::string::String,

    /// Required. Id of the requesting object
    /// If auto-generating Id server-side, remove this field and
    /// router_id from the method_signature of Create RPC
    pub router_id: std::string::String,

    /// Required. The resource being created
    pub router: std::option::Option<crate::model::Router>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateRouterRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateRouterRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [router_id][crate::model::CreateRouterRequest::router_id].
    pub fn set_router_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.router_id = v.into();
        self
    }

    /// Sets the value of [router][crate::model::CreateRouterRequest::router].
    pub fn set_router<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Router>,
    {
        self.router = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [router][crate::model::CreateRouterRequest::router].
    pub fn set_or_clear_router<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Router>,
    {
        self.router = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateRouterRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateRouterRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.CreateRouterRequest"
    }
}

/// Message for updating a Router
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateRouterRequest {
    /// Required. Field mask is used to specify the fields to be overwritten in the
    /// Router resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The resource being updated
    pub router: std::option::Option<crate::model::Router>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateRouterRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateRouterRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateRouterRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [router][crate::model::UpdateRouterRequest::router].
    pub fn set_router<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Router>,
    {
        self.router = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [router][crate::model::UpdateRouterRequest::router].
    pub fn set_or_clear_router<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Router>,
    {
        self.router = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateRouterRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateRouterRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.UpdateRouterRequest"
    }
}

/// Message for deleting a Router
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteRouterRequest {
    /// Required. Name of the resource
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteRouterRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteRouterRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteRouterRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteRouterRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.DeleteRouterRequest"
    }
}

/// Represents the metadata of the long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Server-defined resource path for the target of the operation.
    pub target: std::string::String,

    /// Output only. Name of the verb executed by the operation.
    pub verb: std::string::String,

    /// Output only. Human-readable status of the operation, if any.
    pub status_message: std::string::String,

    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have been cancelled successfully
    /// have [Operation.error][] value with a
    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
    /// `Code.CANCELLED`.
    ///
    /// [google.rpc.Status.code]: rpc::model::Status::code
    pub requested_cancellation: bool,

    /// Output only. API version used to start the operation.
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target][crate::model::OperationMetadata::target].
    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target = v.into();
        self
    }

    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.verb = v.into();
        self
    }

    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.status_message = v.into();
        self
    }

    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.requested_cancellation = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for OperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.OperationMetadata"
    }
}

/// Message for requesting the diagnostics of a network within a specific zone.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiagnoseNetworkRequest {
    /// Required. The name of the network resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DiagnoseNetworkRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DiagnoseNetworkRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DiagnoseNetworkRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.DiagnoseNetworkRequest"
    }
}

/// DiagnoseNetworkResponse contains the current status for a specific network.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiagnoseNetworkResponse {
    /// The time when the network status was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// The network status of a specific network.
    pub result: std::option::Option<crate::model::diagnose_network_response::NetworkStatus>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DiagnoseNetworkResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_time][crate::model::DiagnoseNetworkResponse::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::DiagnoseNetworkResponse::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [result][crate::model::DiagnoseNetworkResponse::result].
    pub fn set_result<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::diagnose_network_response::NetworkStatus>,
    {
        self.result = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [result][crate::model::DiagnoseNetworkResponse::result].
    pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::diagnose_network_response::NetworkStatus>,
    {
        self.result = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DiagnoseNetworkResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.DiagnoseNetworkResponse"
    }
}

/// Defines additional types related to [DiagnoseNetworkResponse].
pub mod diagnose_network_response {
    #[allow(unused_imports)]
    use super::*;

    /// NetworkStatus has a list of status for the subnets under the current
    /// network.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct NetworkStatus {
        /// A list of status for the subnets under the current network.
        pub subnet_status: std::vec::Vec<crate::model::SubnetStatus>,

        /// The MACsec status of internal links.
        pub macsec_status_internal_links:
            crate::model::diagnose_network_response::network_status::MacsecStatus,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl NetworkStatus {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [subnet_status][crate::model::diagnose_network_response::NetworkStatus::subnet_status].
        pub fn set_subnet_status<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::SubnetStatus>,
        {
            use std::iter::Iterator;
            self.subnet_status = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [macsec_status_internal_links][crate::model::diagnose_network_response::NetworkStatus::macsec_status_internal_links].
        pub fn set_macsec_status_internal_links<
            T: std::convert::Into<
                    crate::model::diagnose_network_response::network_status::MacsecStatus,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.macsec_status_internal_links = v.into();
            self
        }
    }

    impl wkt::message::Message for NetworkStatus {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.edgenetwork.v1.DiagnoseNetworkResponse.NetworkStatus"
        }
    }

    /// Defines additional types related to [NetworkStatus].
    pub mod network_status {
        #[allow(unused_imports)]
        use super::*;

        /// Denotes the status of MACsec sessions for the links of a zone.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum MacsecStatus {
            /// MACsec status not specified, likely due to missing metrics.
            Unspecified,
            /// All relevant links have at least one MACsec session up.
            Secure,
            /// At least one relevant link does not have any MACsec sessions up.
            Unsecure,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [MacsecStatus::value] or
            /// [MacsecStatus::name].
            UnknownValue(macsec_status::UnknownValue),
        }

        #[doc(hidden)]
        pub mod macsec_status {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl MacsecStatus {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Secure => std::option::Option::Some(1),
                    Self::Unsecure => std::option::Option::Some(2),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("MACSEC_STATUS_UNSPECIFIED"),
                    Self::Secure => std::option::Option::Some("SECURE"),
                    Self::Unsecure => std::option::Option::Some("UNSECURE"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for MacsecStatus {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for MacsecStatus {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for MacsecStatus {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Secure,
                    2 => Self::Unsecure,
                    _ => Self::UnknownValue(macsec_status::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for MacsecStatus {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "MACSEC_STATUS_UNSPECIFIED" => Self::Unspecified,
                    "SECURE" => Self::Secure,
                    "UNSECURE" => Self::Unsecure,
                    _ => Self::UnknownValue(macsec_status::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for MacsecStatus {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Secure => serializer.serialize_i32(1),
                    Self::Unsecure => serializer.serialize_i32(2),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for MacsecStatus {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<MacsecStatus>::new(
                    ".google.cloud.edgenetwork.v1.DiagnoseNetworkResponse.NetworkStatus.MacsecStatus"))
            }
        }
    }
}

/// Message for requesting the diagnostics of an interconnect within a specific
/// zone.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiagnoseInterconnectRequest {
    /// Required. The name of the interconnect resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DiagnoseInterconnectRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DiagnoseInterconnectRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DiagnoseInterconnectRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.DiagnoseInterconnectRequest"
    }
}

/// DiagnoseInterconnectResponse contains the current diagnostics for a
/// specific interconnect.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiagnoseInterconnectResponse {
    /// The time when the interconnect diagnostics was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// The network status of a specific interconnect.
    pub result: std::option::Option<crate::model::InterconnectDiagnostics>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DiagnoseInterconnectResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_time][crate::model::DiagnoseInterconnectResponse::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::DiagnoseInterconnectResponse::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [result][crate::model::DiagnoseInterconnectResponse::result].
    pub fn set_result<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::InterconnectDiagnostics>,
    {
        self.result = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [result][crate::model::DiagnoseInterconnectResponse::result].
    pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::InterconnectDiagnostics>,
    {
        self.result = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DiagnoseInterconnectResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.DiagnoseInterconnectResponse"
    }
}

/// Message for requesting diagnostics of a router within a specific zone.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiagnoseRouterRequest {
    /// Required. The name of the router resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DiagnoseRouterRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DiagnoseRouterRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DiagnoseRouterRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.DiagnoseRouterRequest"
    }
}

/// DiagnoseRouterResponse contains the current status for a specific router.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiagnoseRouterResponse {
    /// The time when the router status was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// The network status of a specific router.
    pub result: std::option::Option<crate::model::RouterStatus>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DiagnoseRouterResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_time][crate::model::DiagnoseRouterResponse::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::DiagnoseRouterResponse::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [result][crate::model::DiagnoseRouterResponse::result].
    pub fn set_result<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::RouterStatus>,
    {
        self.result = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [result][crate::model::DiagnoseRouterResponse::result].
    pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::RouterStatus>,
    {
        self.result = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DiagnoseRouterResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.DiagnoseRouterResponse"
    }
}

/// Message for initializing a specified zone
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InitializeZoneRequest {
    /// Required. The name of the zone resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InitializeZoneRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::InitializeZoneRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for InitializeZoneRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.InitializeZoneRequest"
    }
}

/// The response of initializing a zone
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InitializeZoneResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InitializeZoneResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for InitializeZoneResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.edgenetwork.v1.InitializeZoneResponse"
    }
}

/// ResourceState describes the state the resource.
/// A normal lifecycle of a new resource being created would be: PENDING ->
/// PROVISIONING -> RUNNING. A normal lifecycle of an existing resource being
/// deleted would be: RUNNING -> DELETING. Any failures during processing will
/// result the resource to be in a SUSPENDED state.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ResourceState {
    /// Unspecified state.
    StateUnknown,
    /// The resource is being prepared to be applied to the rack.
    StatePending,
    /// The resource has started being applied to the rack.
    StateProvisioning,
    /// The resource has been pushed to the rack.
    StateRunning,
    /// The resource failed to push to the rack.
    StateSuspended,
    /// The resource is under deletion.
    StateDeleting,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [ResourceState::value] or
    /// [ResourceState::name].
    UnknownValue(resource_state::UnknownValue),
}

#[doc(hidden)]
pub mod resource_state {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl ResourceState {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::StateUnknown => std::option::Option::Some(0),
            Self::StatePending => std::option::Option::Some(1),
            Self::StateProvisioning => std::option::Option::Some(2),
            Self::StateRunning => std::option::Option::Some(3),
            Self::StateSuspended => std::option::Option::Some(4),
            Self::StateDeleting => std::option::Option::Some(5),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::StateUnknown => std::option::Option::Some("STATE_UNKNOWN"),
            Self::StatePending => std::option::Option::Some("STATE_PENDING"),
            Self::StateProvisioning => std::option::Option::Some("STATE_PROVISIONING"),
            Self::StateRunning => std::option::Option::Some("STATE_RUNNING"),
            Self::StateSuspended => std::option::Option::Some("STATE_SUSPENDED"),
            Self::StateDeleting => std::option::Option::Some("STATE_DELETING"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for ResourceState {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for ResourceState {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for ResourceState {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::StateUnknown,
            1 => Self::StatePending,
            2 => Self::StateProvisioning,
            3 => Self::StateRunning,
            4 => Self::StateSuspended,
            5 => Self::StateDeleting,
            _ => Self::UnknownValue(resource_state::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for ResourceState {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "STATE_UNKNOWN" => Self::StateUnknown,
            "STATE_PENDING" => Self::StatePending,
            "STATE_PROVISIONING" => Self::StateProvisioning,
            "STATE_RUNNING" => Self::StateRunning,
            "STATE_SUSPENDED" => Self::StateSuspended,
            "STATE_DELETING" => Self::StateDeleting,
            _ => Self::UnknownValue(resource_state::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for ResourceState {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::StateUnknown => serializer.serialize_i32(0),
            Self::StatePending => serializer.serialize_i32(1),
            Self::StateProvisioning => serializer.serialize_i32(2),
            Self::StateRunning => serializer.serialize_i32(3),
            Self::StateSuspended => serializer.serialize_i32(4),
            Self::StateDeleting => serializer.serialize_i32(5),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for ResourceState {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceState>::new(
            ".google.cloud.edgenetwork.v1.ResourceState",
        ))
    }
}

/// Defines the remote peering destination for the interface. It is required
/// when peering separation is enabled.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RemotePeeringNetworkType {
    /// Unspecified.
    Unspecified,
    /// Customer's trusted internal network.
    CustomerInternal,
    /// Customer's untrust network that has internet access.
    CustomerInternet,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [RemotePeeringNetworkType::value] or
    /// [RemotePeeringNetworkType::name].
    UnknownValue(remote_peering_network_type::UnknownValue),
}

#[doc(hidden)]
pub mod remote_peering_network_type {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl RemotePeeringNetworkType {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::CustomerInternal => std::option::Option::Some(1),
            Self::CustomerInternet => std::option::Option::Some(2),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => {
                std::option::Option::Some("REMOTE_PEERING_NETWORK_TYPE_UNSPECIFIED")
            }
            Self::CustomerInternal => {
                std::option::Option::Some("REMOTE_PEERING_NETWORK_TYPE_CUSTOMER_INTERNAL")
            }
            Self::CustomerInternet => {
                std::option::Option::Some("REMOTE_PEERING_NETWORK_TYPE_CUSTOMER_INTERNET")
            }
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for RemotePeeringNetworkType {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for RemotePeeringNetworkType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for RemotePeeringNetworkType {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::CustomerInternal,
            2 => Self::CustomerInternet,
            _ => Self::UnknownValue(remote_peering_network_type::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for RemotePeeringNetworkType {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "REMOTE_PEERING_NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
            "REMOTE_PEERING_NETWORK_TYPE_CUSTOMER_INTERNAL" => Self::CustomerInternal,
            "REMOTE_PEERING_NETWORK_TYPE_CUSTOMER_INTERNET" => Self::CustomerInternet,
            _ => Self::UnknownValue(remote_peering_network_type::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for RemotePeeringNetworkType {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::CustomerInternal => serializer.serialize_i32(1),
            Self::CustomerInternet => serializer.serialize_i32(2),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for RemotePeeringNetworkType {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RemotePeeringNetworkType>::new(
            ".google.cloud.edgenetwork.v1.RemotePeeringNetworkType",
        ))
    }
}
